#ifndef ASPRITE_H
#define ASPRITE_H

#include "Sprite.h"
#include <list>

class ASprite: public Sprite
{
public:
	//Constructors
	ASprite(float x, float y, int w, int h, SDL_Surface *spritesheet, int reels, int frames);
	ASprite();
	//Updates the current frame
	void update(Uint32 ticks);
	//Sets Framerate in number of frames per second
	void setFramerate(float rate);
	//Sets current Frame
	void setCurrentframe(int frame);
	//Sets current reel
	void setCurrentreel(int reel);
	//Sets the image oscillation
	void setOscillation(bool osc);
	//Sets the image to animate or remain motionless
	void animate(bool anim);
	//returns the current frame
	int getCurrentframe();
	//returns the current reel
	int getCurrentreel();
	//Advances to the next frame
	void nextframe();
	//Return Clip
	SDL_Rect* getClip();

//private:
	//The rect for the image cutout
	SDL_Rect* Image;
	//The current image being displayed from the current reel
	int currentframe;
	//The maximum number of frames per reel
	int maxframes;
	//The current reel number
	int currentreel;
	//The maximum number of reels
	int maxreels;
	//Determines if the reel oscillates back and forth between the max and min number of frames
	bool oscillate;
	//Used to determine if the frame is advanced in the reverse direction with oscillation enabled
	bool rev;
	//Limits the rate at which the frames advance
	float framerate;
	//Keeps track of the last set of ticks
	int oldtime;
	int time;
	//Determines whether the image is static
	bool animated;
	//Used to delay frame change in certain situations
	bool animdelay;
};

#endif
